#ifndef _APPLICATION_H_
#define _APPLICATION_H_
    
#include "project.h"   

//任务变量宏定义    
#define  GCCOM_TASK_NUM_MAX 4    
 
    
    
//函数指针，申明
typedef void (*GCCOMTaskPollFunc)( void );
typedef struct
{
    //Task时间间隔
    uint16_t mPollInterval;
    //Task任务函数入口
    GCCOMTaskPollFunc mPollFunc;
} TaskAttr; 

typedef union
{
    struct
    {
        //0
        unsigned char FirstAdd :8;
        //1
        unsigned char        :1;
        unsigned char LEDWE3 :1;
        unsigned char LEDWD3 :1;
        unsigned char LEDWC3 :1;
        unsigned char LEDWB3 :1;
        unsigned char LEDWG3 :1;
        unsigned char LEDWF3 :1;
        unsigned char LEDWA3 :1;
        //2
        unsigned char        :1;
        unsigned char LEDWE2 :1;
        unsigned char LEDWD2 :1;
        unsigned char LEDWC2 :1;
        unsigned char LEDWB2 :1;
        unsigned char LEDWG2 :1;
        unsigned char LEDWF2 :1;
        unsigned char LEDWA2 :1;
        //3
        unsigned char        :1;
        unsigned char LEDWE1 :1;
        unsigned char LEDWD1 :1;
        unsigned char LEDWC1 :1;
        unsigned char LEDWB1 :1;
        unsigned char LEDWG1 :1;
        unsigned char LEDWF1 :1;
        unsigned char LEDWA1 :1;
        //4
        unsigned char       :1;
        unsigned char LEDR2 :1;
        unsigned char LEDR3 :1;
        unsigned char LEDR5 :1;
        unsigned char LEDR4 :1;
        unsigned char LEDB3 :1;
        unsigned char LEDB2 :1;
        unsigned char LEDB1 :1;
        //5
        unsigned char:3;
        unsigned char LEDB4 :1;
        unsigned char LEDW9 :1;
        unsigned char LEDW8 :1;
        unsigned char LEDG1 :1;
        unsigned char LEDR1 :1;
        
        //6
        unsigned char       :1;
        unsigned char LEDW3 :1;
        unsigned char LEDW4 :1;
        unsigned char LEDW5 :1;
        unsigned char LEDW6 :1;
        unsigned char LEDW7 :1;
        unsigned char LEDW2 :1;
        unsigned char LEDW1 :1;
        
        //7
        unsigned char     :1;
        unsigned char TP1 :1;
        unsigned char TP2 :1;
        unsigned char TP5 :1;
        unsigned char TP4 :1;
        unsigned char TP3 :1;
        unsigned char     :2;
        //8
        unsigned char     :1;
        unsigned char BR0 :1;
        unsigned char BR1 :1;
        unsigned char BR2 :1;
        unsigned char BR3 :1;
        unsigned char     :3;     
    }bits;
     unsigned char mCMD[9];
}CON_CMD;

typedef union
{
    struct
    {
        unsigned char muteChange:1;
        unsigned char CycSysPage:3;
        unsigned char Fun1state:2;
        unsigned char Fun2state:2;
        
        unsigned char Fun3state:3;
        unsigned char Flashflag:1;
        unsigned char Fun8state:2;
        unsigned char Runstate:1;
        unsigned char recive_msg_flag:1; //20250620
        
        unsigned char RunCount:4;
        unsigned char :4;
        
    }bits;
    unsigned char mFlag[3];
}SysFlag;

enum {
    FALSE = 0,
    TRUE  = 1
};


extern CON_CMD  CySysCMD;
extern SysFlag  CySysFlag;





 void CySys_init_slaver(void);
 void CySysUserTickInit(void);
 void GCCOM_Task_Polling(void);
 void CySys_init(void);

#endif 
    